<?php defined( '_VALID_MOS' ) or die( 'Restricted access' );?>
<?php 
global $mosConfig_absolute_path, $mosConfig_live_site;
if (file_exists( $mosConfig_absolute_path.'/components/com_jcs/languages/'.$mosConfig_lang.'.php' ))
    include( $mosConfig_absolute_path.'/components/com_jcs/languages/'.$mosConfig_lang.'.php' );
else
    require( $mosConfig_absolute_path.'/components/com_jcs/languages/english.php' );
?>
<table class="contentpanopen" width="100%">
  <TR>
    <td class="componentheading">
    <?php echo _REGISTER_TITLE; ?>
    </td>
  </TR>
</table>

<P><?php echo $JCS_REGISTER ?></P>

<?php
		$validate = josSpoofValue();
		?>
		<script language="javascript" type="text/javascript">
		
    function submitbutton_reg() {
			var form = document.mosForm;
			var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", "i");

			// do field validation
			if (form.name.value == "") {
				alert( "<?php echo html_entity_decode(_REGWARN_NAME);?>" );
			} else if (form.username.value == "") {
				alert( "<?php echo html_entity_decode(_REGWARN_UNAME);?>" );
			} else if (r.exec(form.username.value) || form.username.value.length < 3) {
				alert( "<?php printf( html_entity_decode(_VALID_AZ09_USER), html_entity_decode(_PROMPT_UNAME), 2 );?>" );
			} else if (form.email.value == "") {
				alert( "<?php echo html_entity_decode(_REGWARN_MAIL);?>" );
			} else if (form.password.value.length < 6) {
				alert( "<?php echo html_entity_decode(_REGWARN_PASS);?>" );
			} else if (form.password2.value == "") {
				alert( "<?php echo html_entity_decode(_REGWARN_VPASS1);?>" );
			} else if ((form.password.value != "") && (form.password.value != form.password2.value)){
				alert( "<?php echo html_entity_decode(_REGWARN_VPASS2);?>" );
			} else if (r.exec(form.password.value)) {
				alert( "<?php printf( html_entity_decode(_VALID_AZ09), html_entity_decode(_REGISTER_PASS), 6 );?>" );
			} else {
				form.submit();
			}
		}
		</script>

  <FORM action="<?php echo $mosConfig_live_site; ?>/index.php" name="mosForm" method="get">

		<table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
		<tr>
			<td colspan="2"><?php echo _REGISTER_REQUIRED; ?></td>
		</tr>
		<tr>
			<td width="30%">
				<?php echo _REGISTER_NAME; ?> *
			</td>
		  	<td>
		  		<input type="text" name="name" size="40" value="" class="inputbox" maxlength="50" />
		  	</td>
		</tr>
		<tr>
			<td>
				<?php echo _REGISTER_UNAME; ?> *
			</td>
			<td>
				<input type="text" name="username" size="40" value="" class="inputbox" maxlength="25" />
			</td>
		</tr>
		<tr>
			<td>
				<?php echo _REGISTER_EMAIL; ?> *
			</td>
			<td>
				<input type="text" name="email" size="40" value="" class="inputbox" maxlength="100" />
			</td>
		</tr>
		<tr>
			<td>
				<?php echo _REGISTER_PASS; ?> *
			</td>
		  	<td>
		  		<input class="inputbox" type="password" name="password" size="40" value="" />
		  	</td>
		</tr>
		<tr>
			<td>
				<?php echo _REGISTER_VPASS; ?> *
			</td>
			<td>
				<input class="inputbox" type="password" name="password2" size="40" value="" />
			</td>
		</tr>
    <?php
        if (file_exists($mosConfig_absolute_path.'/administrator/components/com_securityimages/client.php')) {
      	  include ($mosConfig_absolute_path.'/administrator/components/com_securityimages/client.php');
          ?>
      		<tr>
      			  <td><?php echo getSecurityImageTextHeader(); ?></td>
      			  <td><?php echo getSecurityImageField('securityimage_newpass'); ?> </td>
      		</tr>
      		<tr>
      		<td>&nbsp;</td>	
      		<td><?php echo insertSecurityImage('securityimage_newpass'); ?></td>
      		</tr>
        <?php 
        }
        ?>		
    </table>
    <INPUT type="button" class="button" value="<?php echo _BUTTON_SEND_REG;?>" onclick="submitbutton_reg()" />
		<input type="hidden" name="id" value="0" />
		<input type="hidden" name="gid" value="0" />
		<input type="hidden" name="option" value="com_jcs" />
		<input type="hidden" name="task" value="registration" />
		<input type="hidden" name="<?php echo $validate; ?>" value="1" />
    </form>
		